package com.lantosec.hmrp.modules.internal.mapper;

import com.lantosec.hmrp.modules.internal.entity.InternalNote;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lantosec.hmrp.modules.internal.entity.InternalTaskDetail;
import com.lantosec.hmrp.modules.internal.entity.InternalTaskExecutor;
import org.apache.ibatis.annotations.Param;

/**
 * <p>
 * 评价记录 Mapper 接口
 * </p>
 *
 * @author AutoCode
 * @since 2020-04-23
 */
public interface InternalNoteMapper extends BaseMapper<InternalNote> {

    /**
     * 查询任务明细id,internal_task_id,executor_id
     *
     * @param internalPlanId
     * @param targetId
     * @return
     */
    InternalTaskDetail getInternalTaskDetail(@Param("internalPlanId") Integer internalPlanId, @Param("targetId") String targetId, @Param("internalTaskDetailId") Integer internalTaskDetailId);

    /**
     * 查询评价人的评价任务
     *
     * @param internalTaskId
     * @param executorUserId
     * @return
     */
    InternalTaskExecutor getInternalTaskExecutor(@Param("internalTaskId") Integer internalTaskId, @Param("executorUserId") String executorUserId);

    /**
     * 更新评价任务的被评价人数
     *
     * @param internalTaskExecutorId
     * @param targetFinishednum
     */
    void updateInternalTaskExecutor(@Param("internalTaskExecutorId") Integer internalTaskExecutorId, @Param("targetFinishednum") Integer targetFinishednum);

    /**
     * 更新评价任务表中的完成评价人数
     *
     * @param internalTaskId
     */
    void updateInternalTask(@Param("internalTaskId") Integer internalTaskId);
}
